$(document).ready(function() {
	$("#tabs").tabs();
	var relation_id = $("#relation_id").val();
	if (relation_id != "0") {
		getRelationMeta(relation_id);
	} else {
		$("#tabs").css("top", "10px");
	}
});

function getRelationMeta(id) {
	var lang = $("#display-lang").val();
	var data = {};
	data["id"] = id;
	data = JSON.stringify(data);
	data = ("data=" + encodeURIComponent(data));
	$.ajax({
		url : "/sview/relationInfo",
		async : true,
		data : data,
		dataType : "json",
		type : "post",
		success : function(result) {
			var name = result["name"];
//			var user = result["user"];
			var group = result["group"];
			var date = result["date"];
			$("#rel_title").text(name);
			var showText;
			if(lang == 'en'){
				$("#rel_meta").html("group: " + group + "<br />" + "Date: " + date);
			}else if(lang == 'zh'){
				$("#rel_meta").html("编辑组: " + group + "<br />" + "创建日期: " + date);
			}
		}
	});
}